<template>
  <div>
    <h3>薪资页面</h3>
    <hr />
    <table-node @childEvt="myEvt" :list="list" :bodylist="bodylist" />
  </div>
</template>
<script>
// import child from "./list.vue";
export default {
//   components: { child },
  data() {
    return {
      list: [
        { id: "name", name: "姓名" },
        { id: "base", name: "基本工资" },
        { id: "jx", name: "绩效" },
        { id: "other", name: "其他" },
        { id: "act", name: "操作" },
      ],
      bodylist: [],
    };
  },
  created() {
    let temp = [];
    for (let i = 0; i < 6; i++) {
      temp.push({
        id: i,
        name: "张三" + i,
        base: Math.ceil(Math.random() * 4000 + 2000),
        other: Math.ceil(Math.random() * 3000 + 2000),
        jx: Math.ceil(Math.random() * 3000 + 2000),
      });
    }
    this.bodylist = temp;
  },
  methods: {
    myEvt(row) {
      console.log(row.name);
    },
  },
};
</script>